Skip to content

PYTHON-5214 - Improve BSON decoding InvalidBSON error message#2605

Merged
NoahStapp merged 1 commit intomongodb:masterfrom
NoahStapp:PYTHON-5214
Oct 29, 2025
Merged

PYTHON-5214 - Improve BSON decoding InvalidBSON error message#2605
NoahStapp merged 1 commit intomongodb:masterfrom
NoahStapp:PYTHON-5214

Conversation

@NoahStapp
Copy link
Contributor

Our current _decode_all() method can raise an InvalidBSON("invalid object size") error for bad BSON messages. This PR updates that message to be more helpful for users:

invalid object size: expected {obj_size}, got {data_len - position}

@NoahStapp NoahStapp requested a review from a team as a code owner October 27, 2025 14:06
@NoahStapp NoahStapp requested a review from Jibola October 27, 2025 14:06
@NoahStapp NoahStapp merged commit b607ef1 into mongodb:master Oct 29, 2025
75 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments